import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";

// https://vitejs.dev/config/
export default defineConfig({
  base: './',
  server: {
    proxy: {
      "/certificate": {
        // target: "http://223.4.71.103/certificate",
        target: "https://szcl.zjdpf.org.cn/certificate",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/certificate/, ""),
      },
      "/gateway": {
        target: "https://withinst.cjrfw.org.cn/gateway",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/gateway/, ""),
      },
    },
  },
    build: {
      outDir: 'build',
    },
    plugins: [uni()],
    transpileDependencies: ['@dcloudio/uni-ui']
  });
